''' Mission 7 - Personal Billboard Extra Spicy Remix This remix uses three lists - two for A and B, and another for the color, which is used for the pixels. One variable for the index (choice) is used throughout. It also includes the button to break the loop and end the program ''' from codex import * from time import sleep choice = 0 my_pictures = [pics.HEART, pics.PLANE, pics.TSHIRT, pics.TIARA, pics.HOUSE, pics.TARGET, pics.ASLEEP, pics.HAPPY] my_otherlist = [GREEN, "Happy Day", RED, "Be awesome!", YELLOW, "Live life", BLUE, "I'll be back", PURPLE] my_colors = [ORANGE, BROWN, CYAN, MAGENTA, DARK_GREEN, WHITE, PINK, DARK_BLUE] LAST_INDEX = len(my_pictures) - 1 my_list = my_pictures # MAIN PROGRAM while True: my_item = my_list[choice] color = my_colors[choice] if type(my_item) == tuple: display.fill(my_item) else: display.show(my_item) pixels.set(0, color) pixels.set(1, color) pixels.set(2, color) pixels.set(3, color) # select list to display if buttons.was_pressed(BTN_A): my_list = my_pictures if buttons.was_pressed(BTN_B): my_list = my_otherlist # scroll forward and backward if buttons.was_pressed(BTN_L): choice = choice - 1 if choice < 0: choice = LAST_INDEX if buttons.was_pressed(BTN_R): choice = choice + 1 if choice > LAST_INDEX: choice = 0 # break out of the loop if buttons.was_pressed(BTN_D): break